﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;

public partial class Buyer_AddPayPal : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button4_Click(object sender, EventArgs e)
    {
        //HttpWebRequest http = WebRequest.Create("http://") as HttpWebRequest;
        //http.Proxy = proxy;
        //http.AllowAutoRedirect = true;
        //http.Method = "POST";
        //http.ContentType = "application/x-www-form-urlencoded";
        //http.UserAgent = userAgent;
        //http.CookieContainer = new CookieContainer();
        //http.CookieContainer.Add(cookies);
        //http.Referer = referer;
        //byte[] dataBytes = UTF8Encoding.UTF8.GetBytes(postData);
        //http.ContentLength = dataBytes.Length;
        //using (Stream postStream = http.GetRequestStream())
        //{
        //    postStream.Write(dataBytes, 0, dataBytes.Length);
        //}
        //HttpWebResponse httpResponse = http.GetResponse() as HttpWebResponse;
        //headers = http.Headers;
        //cookies.Add(httpResponse.Cookies);
        //Response.Write(ScreenScrape("https://www.paypal.com/cgi-bin/webscr?cmd=_customer-billing-agreement&token=BA-6V648648BA632343Y"));

    }

    public static string ScreenScrape(string url)
    {
        System.Net.WebRequest request = System.Net.WebRequest.Create(url);
        // set properties of the request
        using (System.Net.WebResponse response = request.GetResponse())
        {
            using (System.IO.StreamReader reader = new System.IO.StreamReader(response.GetResponseStream()))
            {
                return reader.ReadToEnd();
            }
        }
    }
    protected void btnpaypal_Click(object sender, EventArgs e)
    {

    }
}
